# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=routerhunter
pkgver=21.4da257c
pkgrel=4
groups=('blackarch' 'blackarch-scanner' 'blackarch-networking')
pkgdesc='Tool used to find vulnerable routers and devices on the Internet and perform tests.'
arch=('any')
url='https://github.com/jh00nbr/Routerhunter-2.0'
license=('custom:unknown')
depends=('python2' 'python2-simplejson' 'python2-requests')
makedepends=('git')
source=("$pkgname::git+https://github.com/jh00nbr/Routerhunter-2.0.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|bin/env python|bin/env python2|' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

